#navcheck {
  position: fixed;
  opacity: 0;
}

label {
  position: absolute;
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
  background: none;
  cursor: pointer;
}

label::before {
  position: fixed;
  z-index: 1;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.25);
  content: '';
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

label .burger {
  position: fixed;
  top: 1em;
  left: 1em;
  z-index: 3;
  width: 1.5em;
  height: 1.5em;
  margin: 0;
  padding: 0;
  transition: opacity 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

label .burger::before,
label .burger .bar, label .burger::after {
  position: absolute;
  left: 0;
  display: block;
  width: 100%;
  height: 12%;
  background: #313131;
  content: '';
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

label .burger .bar {
  top: 44%;
}

label .burger::before {
  top: 0;
  transform-origin: top left;
}

label .burger::after {
  bottom: 0;
  transform-origin: bottom left;
}

#navcheck:focus + label .burger,
label:hover .burger {
  opacity: .70;
}

nav {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  flex-flow: column nowrap;
  justify-content: center;
  align-items: flex-start;
  transform: translate3d(0, 0, 0);
  /* material acceleration */
  transform: translateX(-100%);
  will-change: transform;
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

nav::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  width: 25em;
  background: #f03752;
  content: '';
  transform: skewX(15deg) translateX(-100%);
  transform-origin: bottom left;
  will-change: transform;
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

@media (min-width: 40em) {
  nav::before {
    width: 40em;
  }
}

nav a {
  margin: .5em 0;
  padding: .2em 2em;
  font-size: 1.5em;
  color: white;
  text-decoration: none;
  font-weight: 500;
  transform: translateX(-100%);
  transition: color .5s, transform .5s;
  transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1);
}

nav a:nth-child(1) {
  transition-delay: 0s, 100ms;
}

nav a:nth-child(2) {
  transition-delay: 0s, 150ms;
}

nav a:nth-child(3) {
  transition-delay: 0s, 200ms;
}

nav a:nth-child(4) {
  transition-delay: 0s, 250ms;
}

nav a:nth-child(5) {
  transition-delay: 0s, 300ms;
}

nav a:nth-child(6) {
  transition-delay: 0s, 350ms;
}

nav a:nth-child(7) {
  transition-delay: 0s, 400ms;
}

nav a:nth-child(8) {
  transition-delay: 0s, 450ms;
}

nav a:nth-child(9) {
  transition-delay: 0s, 500ms;
}

nav a:nth-child(10) {
  transition-delay: 0s, 550ms;
}

nav a:nth-child(11) {
  transition-delay: 0s, 600ms;
}

nav a:nth-child(12) {
  transition-delay: 0s, 650ms;
}

nav a:nth-child(13) {
  transition-delay: 0s, 700ms;
}

nav a:hover, nav a:focus {
  color: #313131;
}

main {
  overflow: hidden;
}

main .content {
  transform: translate3d(0, 0, 0);
  /* material acceleration */
  will-change: transform, filter;
  transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

[id="navcheck"]:checked + label::before {
  opacity: 1;
  pointer-events: auto;
}

[id="navcheck"]:checked + label .burger::before, [id="navcheck"]:checked + label .burger::after {
  width: 141.42%;
}

[id="navcheck"]:checked + label .burger::before {
  transform: rotate(45deg) translateY(-50%);
}

[id="navcheck"]:checked + label .burger::after {
  transform: rotate(-45deg) translateY(50%);
}

[id="navcheck"]:checked + label .burger .bar {
  transform: scale(0.1);
}

[id="navcheck"]:checked ~ nav {
  transform: translateX(0);
}

[id="navcheck"]:checked ~ nav::before {
  transform: skewX(15deg) translateX(0);
}

[id="navcheck"]:checked ~ nav a {
  transform: translateX(0);
}

[id="navcheck"]:checked ~ main .content {
  transform: translateX(3em);
  transform-origin: left center;
  filter: blur(2px);
}

/* helper */
.visuallyhidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
}
